﻿using Heima.OA.EFDAL;
using Heima.OA.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Heima.OA.DALFactory
{
    /// <summary>
    /// 简单工厂用来生成实例的，实例的变化封装到工厂里面
    /// 抽象工厂，反射创建实例
    /// Assembly.Load("Heima.OA.EFDAL").CreateInstance("UserInfoDal")  as IUserInfoDal
    /// </summary>
    public partial class StaticDalFactory
    {
        public static string assemblyName = System.Configuration.ConfigurationManager.AppSettings["DalAssemblyName"];
        #region 由模板自动生成
        //public static IUserInfoDal GetUserInfoDal()
        //{
        //    //Assembly.Load("Heima.OA.EFDAL").CreateInstance("Heima.OA.EFDAL.UserInfoDal") as IUserInfoDal
        //    return new UserInfoDal();
        //}
        //public static IOrderInfoDal GetOrderInfoDal()
        //{
        //    return new OrderInfoDal();
        //}
        //public static IRoleInfoDal GetRoleInfoDal()
        //{
        //    return new RoleInfoDal();
        //} 
        #endregion

    }
}
